<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>支持国际化</title>
    <script type="text/javascript" src="../../../jquery.js"></script>
    <script type="text/javascript" src="../../../ui/om-core.js"></script>
    <script type="text/javascript" src="../../../ui/om-validate.js"></script>
    <script type="text/javascript" src="../../../ui/om-button.js"></script>
    <link rel="stylesheet" type="text/css" href="../../../themes/default/om-all.css" />
    <link rel="stylesheet" type="text/css" href="../../common/css/demo.css" />
    <!-- view_source_begin -->
    <style type="text/css">
       label { width: 10em; float: left; }
       label.error { float: none; color: red; padding-left: .5em; vertical-align: top; }
         p { clear: both; }
        em { font-weight: bold; padding-right: 1em; vertical-align: top; }
        .submit { margin-left: 12em; }
        textarea{font-size: 15px;}
    </style>
    <script type="text/javascript">
        $(document).ready(function(){
           $.validator.messages = {
        		   email: "请输入正确的email格式！",
        		   minlength: jQuery.format("至少需要输入 {0} 字符！"),
        		   url: "请输入正确的url地址！",
        		   required: "必填，请输入正确的字符！"
           }
           $("#internationForm").validate({
               submitHandler : function(){
                   alert('提交成功！');
                   $(this)[0].currentForm.reset()
                   return false;
               }
           });
        });
    </script>
    <!-- view_source_end -->
</head>
<body>
<!-- view_source_begin -->
	<form class="cmxform" id="internationForm" method="get" action="">
	   <p>
	     <label for="name">姓名：</label>
	     <em>*</em><input name="name" size="25" class="required" minlength="2" />
	   </p>
	   <p>
	     <label for="email">电子邮箱：</label>
	     <em>*</em><input name="email" size="25"  class="required email" />
	   </p>
	   <p>
	     <label for="url">个人主页：</label>
	     <em>&nbsp;&nbsp;</em><input name="url" size="25"  class="url"/>
	   </p>
	   <p>
	     <label for="comment">个人简介：</label>
	     <em>*</em><textarea name="comment" cols="22"  class="required"></textarea>
	   </p>
	   <p>
	     <input type="submit" value="提   交" class="submit"/>
	   </p>
	 </form>
<!-- view_source_end -->
	 <div id="view-desc">
          校验规则的内置校验信息是支持国际化的，默认是英文。可以通过$.validator.messages = {...}，定义内置的校验信息，如示例源码。
    </div>
</body>
</html>